#ifndef HBASE_CLIENT_H
#define HBASE_CLIENT_H

#include "Cell.h"
#include "Row.h"
#include "RowsShell.h"
#include "TableSchema.h"
#include <optional>
#include <HTTPLib/httplib.h>

class HBaseClient
{
public:
    HBaseClient(std::string  ip, int port);
    ~HBaseClient();

public:
    bool Ok();
    std::optional<std::string> GetClusterVersion();
    std::optional<std::list<std::string>> GetTables();
    std::optional<TableSchema> GetTableInfo(const std::string& tableName);
    bool CreateTable(const TableSchema& tableSchema);
    bool UpdateTable(const TableSchema& tableSchema);
    bool DeleteTable(const std::string& tableName);
    std::optional<std::list<std::string>> GetRows(const std::string& tableName);
    std::optional<Row> GetRow(const std::string& tableName, const std::string& rowKey);
    bool CreateRow(const std::string& tableName, const Row& row);
    bool UpdateRow(const std::string& tableName, const Row& row);
    bool DeleteRow(const std::string& tableName, const std::string& rowKey);
    bool PutCells(const std::string& tableName, const RowsShell& rows);
    bool DeleteCell(const std::string& tableName, const std::string& rowKey, const std::string& column);
    bool DeleteCellOfColumnFamily(const std::string& tableName, const std::string& rowKey, const std::string& columnFamily);
    std::optional<Cell> GetCell(const std::string& tableName, const std::string& rowKey, const std::string& column);
    std::optional<Row> GetCellOfColumnFamily(const std::string& tableName, const std::string& rowKey, const std::string& columnFamily);


private:
    std::string ip;
    int port;
};

#endif //HBASE_CLIENT_H
